package com.example.demo.Server.impl;

import com.example.demo.mapper.ChatMessageMapper;
import com.example.demo.entity.ChatMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ChatService {

    @Autowired
    private  ChatMessageMapper chatMessageMapper;

    public  List<ChatMessage> findByChatId(String chatId) {
        return chatMessageMapper.selectByChatId(chatId);
    }

    public void saveMessage(ChatMessage message) {
        chatMessageMapper.insert(message);


    }
}